#ifndef SYSTEMCONFIG_H
#define SYSTEMCONFIG_H

#include <QWidget>
#include <QTranslator>
#include "ettadatastruct.h"
#include "blldataflow.h"
#include "sqlhelper.h"

namespace Ui {
class SystemConfig;
}

class QPushButton;
class SystemConfig : public QWidget
{
    Q_OBJECT

public:
    explicit SystemConfig(QWidget *parent = nullptr);
    ~SystemConfig();

private slots:
    void changeSystemConfigPageIndexSlot(int index);

    void on_btnUsername_toggled(bool checked);
    void on_btnPassword_toggled(bool checked);
    void on_btnNetwork_toggled(bool checked);
    void on_btnPrint_toggled(bool checked);
    void on_btnTime_toggled(bool checked);
    void on_btnLanguage_toggled(bool checked);
    void on_btnChangeUsername_clicked();
    void on_lineNewUsername_editingFinished();
    void on_btnChangePW_clicked();

    void on_btnCh_clicked();
    void on_btnEn_clicked();

    void on_btnShowOldPw_toggled(bool checked);
    void on_btnShowNewPw_toggled(bool checked);
    void on_btnShowConfirmPw_toggled(bool checked);

    void retranslateUiSlot();
    void setWidgetVisibleSlot(int permission);

    void clearPasswordError();

private:
    void initWidget();
    void saveParam();
    void retranslate(const QString &);
    void clearPasswordInput();

private:
    Ui::SystemConfig *ui;
    BllDataFlow *bdf;
    SqlHelper *sqlHelper;
    QMap<int, QPushButton *> map;
};

#endif // SYSTEMCONFIG_H
